<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  xmlns:o="http://xmlns.heustics.org/schema/myelin/0.1/NodeAcl#new"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/" 
  xmlns:xf="http://www.w3.org/2002/xforms"
  extension-element-prefixes="fhttp"
  exclude-result-prefixes="xsl fhttp o a l xf"
>   
  <xsl:variable name="o:l10n" select="a:get-l10n('&a;NodeAcl#new')"/>
  <xsl:variable name="o:titles-l10n" select="$o:l10n/l:context[@name='titles']/*"/>  
  
  <xsl:template match="a:title[@key='new-acl-group']" mode="a:head-content">
    <xsl:call-template name="a:head-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="a:title[@key='new-acl-group']" mode="a:page-header">
    <xsl:call-template name="a:page-header-title">
      <xsl:with-param name="title" select="$o:titles-l10n[1]"/>
    </xsl:call-template>
  </xsl:template>    
  
  <xsl:template match="a:form[@mode='main' and @status='commit-success']" name="a:new-commit-success">
    <xsl:param name="account" select="/*/a:account"/>
    <xsl:param name="return-action" select="/*/@return-action"/>
    <xsl:choose>
      <xsl:when test="$account/@logged-in">
        <xsl:variable name="inst" select="xf:model/xf:instance/*"/>
        <fhttp:response-uri
          uri='{a:format-url-ext(
            a:format-url-ext(
              a:format-request(
                "edit-acl-group",
                a:public-url($inst/a:node/@node-id),
                $return-action
              ),
              "acl-group-tag",$inst/a:new-tag
            ),
            "msg","new-acl-group"
          )}'
        />
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="a:form-finish">
          <xsl:with-param name="return-to" select="$return-to"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>   
  </xsl:template>   
  
</xsl:stylesheet>

